<template lang="html">
  <div>
    <selfHeader></selfHeader>
    <div class="main">

      <isEmpty v-if='list.length === 0'></isEmpty>
      <div v-else class="userBox">
        <div v-for='(item, index) in list' :key='index' class="listBox">
<!--          <img :src='"http://114.55.102.36:8809" + item.avatar' v-if="item.avatar && item.avatar !== ''">-->
<!--          <span class="icon2-user" v-else></span>-->
          <p>{{ item.account }}</p>
          <span>茶籽数量: {{item.teaNum || 0}}</span>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {goodUpdateTeam, QRcode} from '@/http/api'
import isEmpty from '@/components/isEmpty'
import selfHeader from '@/common/header'

export default {
  components: {
    isEmpty,
    selfHeader
  },
  data() {
    return {
      isempty: true,
      list: [],
      QRSrc: ''
    }
  },
  created() {
    this.getList()
  },
  methods: {
    async getList() {
      const user = JSON.parse(localStorage.getItem('UserMessage'))
      const data = {
        uid: user.user.uid
      }
      const res = await goodUpdateTeam(data)
      if (res.code * 1 === 200) {
        this.list = res.data
      }
    }
  }
}
</script>

<style lang="less" scoped>
.main {
  width: 100%;
  margin-top: 60px;
}

.userBox {
  padding: 0 6px;

  div {
    width: 100%;
    display: flex;
    box-sizing: border-box;
    justify-content: space-between;
    align-items: center;
    padding: 10px 16px;
    border-bottom: 1px solid #048AB9;
    border-radius: 4px;
    overflow: hidden;

    img, .icon2-user {
      display: inline-block;
      width: 40px;
      height: 40px;
      text-align: center;
      line-height: 40px;
      border-radius: 20px;
    }

  }
}

.imageBox {
  width: 200px;
  display: block;
  height: 200px;
  margin: 0 auto;
  background-image: url("../assets/tea.png");
  background-size: 100% 100%;
  background-repeat: no-repeat;
  overflow: hidden;
  border-radius: 6px;
  .QR {
    width: 120px;
    height: 120px;
    margin: 40px auto;
    display: block;
    opacity: .95;
  }
}
</style>
